<?php


use App\Http\Admin\Controller\CommonController;
use Sc\Util\HtmlStructure\Form;

use Sc\Util\HtmlStructure\Html\Html;

Html::create('表单-组合型');

$form = Form::create("demo15Form")->config(['label-width' => '80px']);

$form->addFormItems(
    Form\FormItem::customize("常规组合"),
    Form\FormItem::group(
        Form\FormItem::text('name', '姓名'),
        Form\FormItem::text('phone', '手机号'),
        Form\FormItem::text('email', '邮箱'),
        Form\FormItem::text('address', '地址'),
    ),
    Form\FormItem::customize("带标题和字段的组合，以下信息会包含在other的子级中，如果没有第二个参数other,则不会有层级"),
    Form\FormItem::group(
       '其他信息', 'other'
    )->addItems(
        Form\FormItem::text('zip', '邮编'),
        Form\FormItem::text('company', '公司名称'),
        Form\FormItem::text('position', '职位'),
        Form\FormItem::text('website', '网址'),
    ),
    Form\FormItem::customize("可以添加多个子级组合"),
    Form\FormItem::group(
       '其他信息', 'other1'
    )->addItems(
        Form\FormItem::text('zip', '邮编'),
        Form\FormItem::text('company', '公司名称'),
        Form\FormItem::text('position', '职位'),
        Form\FormItem::text('website', '网址'),
    )->arrayValue(),
    Form\FormItem::customize("表格组合"),
    Form\FormItem::table(
       'table', '表格组合'
    )->addItems(
        Form\FormItem::text('zip', '邮编'),
        Form\FormItem::text('company', '公司名称'),
        Form\FormItem::text('position', '职位'),
        Form\FormItem::text('website', '网址'),
    ),
    Form\FormItem::customize("行内组合"),
    Form\FormItem::inLine(
        Form\FormItem::text('name', '姓名'),
        Form\FormItem::text('phone', '手机号'),
        Form\FormItem::text('email', '邮箱'),
        Form\FormItem::text('address', '地址'),
    ),
);


return $form->render();
